import {dynamicGroup} from "@logicflow/extension";

class ForNodeModel extends dynamicGroup.model {

    initNodeData(data) {
        super.initNodeData(data);
        this.width = 600;
        this.height = 400;
        this.collapsedWidth = 120;
        this.collapsedHeight = 80;
        this.autoResize = false;
        this.resizable = true;
        this.rotatable = true;
        this.isRestrict = true;

        this.setProperties({
            nodeType: 'WHILE',
            collapsible: true,
            radius: 5,
            isCollapsed: true,
            transformWithContainer: true,
            type: 'WHILE',
            category: 'WHILE',
        });
    }

    getNodeStyle() {
        const style = super.getNodeStyle();
        style.stroke = "#E01E5B";
        return style;
    }

    getTextStyle() {
        return {
            color: '#000',     // 设置文字为白色
            fontSize: 14,
            fontWeight: 'bold'
        };
    }

    getAddableOutlineStyle() {
        const style = super.getAddableOutlineStyle();
        style.stroke = "#E01E5B";
        style.strokeDasharray = "3 3";
        return style;
    }

}

class ForNodeView extends dynamicGroup.view {
}

export default {
    type: "WhileNode",
    view: ForNodeView,
    model: ForNodeModel
};